require('./Valuationclass.styl');
import { Boxs, Group, NavBar, Scroller } from 'saltui';
const { HBox, Box, VBox } = Boxs;
const Rollup = require('components/rollup');
class Valuationclass extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            listData:props.evaluateList,//评价列表
        };
    }

    render() {
        let t = this;
        return (
            <div className="valuationclass">
                <Scroller autoRefresh={true} className="page-y">
                    {this.state.listData instanceof Array && this.state.listData.length > 0 ? this.state.listData.map((item, index) => {
                        return (
                            <Rollup
                                key={`class-${index}`}
                                type="theme"
                                title={item.name}
                                id={item.id}
                                listdata={item.childList}
                                handleOnRightClick={t.props.handleOnRightClick}
                            />
                        );
                    }) : <div className="t-FAC">暂无节点数据</div>}
                </Scroller>
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
        if (nextProps.evaluateList != this.state.listData) {
            this.setState({ listData: nextProps.evaluateList })
        }
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

module.exports = Valuationclass;
